<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/1/28 0028
 * Time: 9:15
 */
namespace app\manager\model\validate;

use think\Validate;

class PermissionValidate extends Validate {
    protected $rule =   [
        'name'  => 'require|max:12',
        //'open_id' => 'require',
        'route' => 'require|max:128',
    ];

    protected $message  =   [
        'name.require'     => '权限名不能为空',
        'name.max'     => '权限名不能超过12个字符',
        'route.require'     => '权限的路由不能为空',
        'route.max'     => '权限的路由不能超过128个字符',
    ];

    protected $scene = [
        /*'add'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],
        'edit'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],*/
    ];
}